package cn.qidisoft.edu.hzjt.model.zyc;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author zhangyuancheng
 * @create 2018-11-29 下午4:32
 * @descripition 评价记录表
 */
public class PartyActivityComment {

    private SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    /***
     * 主键ID
     */
    private Integer pJID;

    private String gID;

    /***
     * 父ID
     */
    private String parentId;

    /***
     * 党员ID
     */
    private Integer dYID;

    /***
     * 党员姓名
     */
    private String dYXM;

    /***
     * 星级
     */
    private String stars;

    /***
     * 星级
     */
    private String starString;

    /***
     * 评论内容
     */
    private String contents;

    /***
     * 评论时间
     */
    private Date createTime;

    /***
     * 评论时间
     */
    private String timeString;

    /***
     * 评论附件
     */
    private List<PartyActivityCommentAttrAtt> partyActivityCommentAttrAttList;

    public Integer getpJID() {
        return pJID;
    }

    public void setpJID(Integer pJID) {
        this.pJID = pJID;
    }

    public String getgID() {
        return gID;
    }

    public void setgID(String gID) {
        this.gID = gID;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Integer getdYID() {
        return dYID;
    }

    public void setdYID(Integer dYID) {
        this.dYID = dYID;
    }

    public String getdYXM() {
        return dYXM;
    }

    public void setdYXM(String dYXM) {
        this.dYXM = dYXM;
    }

    public String getStars() {
        return stars;
    }

    public void setStars(String stars) {
        this.stars = stars;
        if(stars!=null){
            int index = Integer.parseInt(stars);
            String star = "<div style=\"text-align:center;height:auto;\" class=\"datagrid-cell datagrid-cell-c2-stars\">";
            for(int i=1;i<=index;i++){
                star+= "<img alt=\""+i+"\" src=\"http://localhost:8080/js/raty/images/star-on.png\" title=\"regular\">";
            }
            star+="</div>";
            this.starString = star;
        }
    }

    public String getContents() {
        return contents;
    }

    public void setContents(String contents) {
        this.contents = contents;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.timeString = fmt.format(createTime);
        this.createTime = createTime;
    }

    public String getTimeString() {
        return timeString;
    }

    public String getStarString() {
        return starString;
    }

    public void setStarString(String starString) {
        this.starString = starString;
    }

    public List<PartyActivityCommentAttrAtt> getPartyActivityCommentAttrAttList() {
        return partyActivityCommentAttrAttList;
    }

    public void setPartyActivityCommentAttrAttList(List<PartyActivityCommentAttrAtt> partyActivityCommentAttrAttList) {
        this.partyActivityCommentAttrAttList = partyActivityCommentAttrAttList;
    }
}
